﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using X.LOG.Abstract;

namespace X.LOG
{
    internal abstract class Util_Backup
    {
        public async static void Log<T>(T log) where T : BaseLog<T>, new()
        {
            await Task.Run(() =>
            {
                LogStashHelper.PostLog(log.LogStashServer, log.LogStashSeverPort, log.Body);
            });
        }

        public async static void Exception<T>(T log) where T : Exception
        {
            await Task.Run(() =>
            {
                LogStashHelper.PostLog(Config.DefaultLogStashServerIp, Config.DefaultLogStashServerPort, log);
            });
        }

        public async static void Debug<T>(T log) where T : new()
        {
            await Task.Run(() =>
            {
                LogStashHelper.PostLog(Config.DefaultLogStashServerIp, Config.DefaultLogStashServerPort, log);
            });
        }
    }
}
